// author : dulred jquery
// date : 2022/9/8
// Using this js before you call jquery.js



//video play static ----function
    function Vi (obj){
        this.start=function(){
            document.querySelector(obj.bo).addEventListener("click",function(){
                $(this).css("display","none")
                document.querySelector(obj.video).play();
            })
            document.querySelector(obj.video).addEventListener("play",function(){
                $(obj.bo).css("display","none")
            })
            document.querySelector(obj.video).addEventListener("pause",function(){
                $(obj.bo).css("display","flex")
            })
        }
        this.start()
    }





//video play popup  -------->dr_demo1
    function Pvi (obj){
            $(obj.target).click(function(){
             var src= $(obj.source).attr("src");
                 $(".vi_box video").attr("src",src)
                 $(".vi_box video").trigger("play")
                $(".vi_box").fadeIn();
           })
      
           $(".vi_box .close").click(function(){
            $(".vi_box video").attr("src","")
            $(".vi_box video").trigger("pause")
              $(".vi_box").fadeOut();
           })
       
    }


    
    
//join slide---- function
function Jslide(obj){
    this.start=function(){
        $(obj.target).click(function(){
            if($(this).find(obj.change.nav2).css("display")=="block"){
                    $(this).removeClass("active").siblings().removeClass("active")
                    $(this).find(obj.change.content).slideUp()
                    $(this).find(obj.change.nav2).css("display","none")
                    $(this).find(obj.change.nav1).css("display","block")
            }else{
                    $(this).addClass("active").siblings().removeClass("active")
                    $(this).siblings().find(obj.change.content).slideUp()
                    $(this).siblings().find(obj.change.nav2).css("display","none")
                    $(this).siblings().find(obj.change.nav1).css("display","block")
                    $(this).find(obj.change.nav2).css("display","block")
                    $(this).find(obj.change.nav1).css("display","none")
                    $(this).find(obj.change.content).slideDown()
            }  
    })
    }
    this.start()
}



//scroll
{/* <script>
    //关于我们
	var winH = $(window).height();
	var winW = $(window).width();
	var widScrollT = 0
    var c1 =0;
    //text内容适配调整
    if(winW<1600){
        c1 = 1100
    }else{
        c1 = 1500
    }
    $(".home_part3_text").css("margin-left",`${(winW-c1)/2}px`)

    $(window).resize(function () {
        winH = $(window).height();
        winW = $(window).width();
        widScrollT = $(window).scrollTop();
    })
    
//运动函数-滚动触发（元素起始位置，元素结束位置，运动起始位置，运动结束位置）
var sMoveFun = function (oStart, oEnd, sStart, sEnd) {
		var ret;
		if (widScrollT >= sStart && widScrollT <= sEnd) {//运行过程中
			ret = oStart + (oEnd - oStart) / (sEnd - sStart) * (widScrollT - sStart) 
		} else if (widScrollT < sStart) {//进入之前
			ret = oStart
		} else if (widScrollT > sEnd) {//离开之后
			ret = oEnd
		}
		return ret;
	}


    $(window).scroll(function () {

        widScrollT = $(window).scrollTop();
        var boxpart3_s = $(".home_part3").offset().top - winH * 0.7
        if (widScrollT >= boxpart3_s) {
            var boxpart3_t2 = sMoveFun(0, -winW * 0.2, boxpart3_s, boxpart3_s + winH * 1.5);
            var boxpart3_t3 = sMoveFun(0, 100, boxpart3_s, boxpart3_s + winH * 1.5);
            var boxpart3_ta = sMoveFun(0, winW * 0.15, boxpart3_s, boxpart3_s + winH);
            $(".home_part3 .con_right .con_right_bg").css("transform", "translateY(" + boxpart3_ta + "px)");
            $(".home_part3 .con_right .con_right_bg").css("background-position", "left " + boxpart3_t3 + "%");
            $(".home_part3 .con_right .con_right_heng").css("transform", "translateX(" + boxpart3_t2 + "px)");
        } else {
            $(".home_part3 .con_right .con_right_bg").css("transform", "translateY(0)");
            $(".home_part3 .con_right .con_right_heng").css("transform", "translateY(0)");
        }  
     })
</script> */}